import { HLRouterInfo } from "../entity/HLRouterInfo";


export enum LifecycleEvent {
  ON_SHOWN = "onShown",
  ON_HIDDEN = "onHidden",
  ON_APPEAR = "onAppear",
  ON_DISAPPEAR = "onDisappear",
  ON_WILL_SHOW = "onWillShow",
  ON_WILL_HIDE = "onWillHide",
  ON_WILL_APPEAR = "onWillAppear",
  ON_WILL_DISAPPEAR = "onWillDisappear",
}

/**
 * 用于模板化的生命周期状态
 */
export enum LifecycleState {
  ON_WILL_SHOW = "onWillShow",
  ON_SHOWN = "onShown",
  ON_WILL_HIDE = "onWillHide",
  ON_HIDDEN = "onHidden",
  ON_DISAPPEAR = "onDisappear",
  ON_WILL_DISAPPEAR = "onWillDisappear",
  ON_BACK_PRESS = "onBackPress",
}

export type LifecycleCallback = (event: LifecycleEvent, router?: HLRouterInfo) => void;

export type LifecycleObserver = (event: LifecycleState, router?: HLRouterInfo) => void | boolean;